﻿using System.Collections.Generic;
using UnityEngine;


namespace SG
{

    public class FontTransformer
    {

        #region 静态接口
        private static FontTransformer m_instance;
        public static FontTransformer Instance()
        {
            if (m_instance == null)
            {
                m_instance = new FontTransformer();
            }
            return m_instance;
        }
        #endregion

        private int shiwanwei;
        private int wanwei;
        private int qianwei;
        private int baiwei;
        private int shiwei;
        private int gewei;
        private List<Sprite> sprites = new List<Sprite>();

        // 高位先进入列表
        public List<Sprite> TransformerBySixCountNumber(int number, string path)
        {
            sprites.Clear();
            shiwanwei = number / 100000;
            wanwei = (number / 10000) % 10;
            qianwei = (number / 1000) % 10;
            baiwei = (number / 100) % 10;
            shiwei = (number / 10) % 10;
            gewei = number % 10;
            //这个脚本 目前没人使用。直接备注上了，如果有人用 请改成异步加载
            //sprites.Add(ResourceLoader.Instance().LoadSprite(path + shiwanwei.ToString()));
            //sprites.Add(ResourceLoader.Instance().LoadSprite(path + wanwei.ToString()));
            //sprites.Add(ResourceLoader.Instance().LoadSprite(path + qianwei.ToString()));
            //sprites.Add(ResourceLoader.Instance().LoadSprite(path + baiwei.ToString()));
            //sprites.Add(ResourceLoader.Instance().LoadSprite(path + shiwei.ToString()));
            //sprites.Add(ResourceLoader.Instance().LoadSprite(path + gewei.ToString()));
            return sprites;
        }
    }
}

